# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CPUMetric',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=10)),
                ('umode', models.IntegerField()),
                ('umode_nice', models.IntegerField()),
                ('smode', models.IntegerField()),
                ('idle', models.IntegerField()),
                ('ts', models.DateTimeField(auto_now=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='DiskStat',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=128)),
                ('reads_completed', models.FloatField()),
                ('reads_merged', models.FloatField()),
                ('sectors_read', models.FloatField()),
                ('ms_reading', models.FloatField()),
                ('writes_completed', models.FloatField()),
                ('writes_merged', models.FloatField()),
                ('sectors_written', models.FloatField()),
                ('ms_writing', models.FloatField()),
                ('ios_progress', models.FloatField()),
                ('ms_ios', models.FloatField()),
                ('weighted_ios', models.FloatField()),
                ('ts', models.DateTimeField(db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='LoadAvg',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('load_1', models.FloatField()),
                ('load_5', models.FloatField()),
                ('load_15', models.FloatField()),
                ('active_threads', models.IntegerField()),
                ('total_threads', models.IntegerField()),
                ('latest_pid', models.IntegerField()),
                ('idle_seconds', models.IntegerField()),
                ('ts', models.DateTimeField(auto_now=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='MemInfo',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('total', models.BigIntegerField(default=0)),
                ('free', models.BigIntegerField(default=0)),
                ('buffers', models.BigIntegerField(default=0)),
                ('cached', models.BigIntegerField(default=0)),
                ('swap_total', models.BigIntegerField(default=0)),
                ('swap_free', models.BigIntegerField(default=0)),
                ('active', models.BigIntegerField(default=0)),
                ('inactive', models.BigIntegerField(default=0)),
                ('dirty', models.BigIntegerField(default=0)),
                ('ts', models.DateTimeField(auto_now=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='NetStat',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('device', models.CharField(max_length=100)),
                ('kb_rx', models.FloatField()),
                ('packets_rx', models.FloatField()),
                ('errs_rx', models.FloatField()),
                ('drop_rx', models.BigIntegerField(default=0)),
                ('fifo_rx', models.BigIntegerField(default=0)),
                ('frame', models.BigIntegerField(default=0)),
                ('compressed_rx', models.BigIntegerField(default=0)),
                ('multicast_rx', models.BigIntegerField(default=0)),
                ('kb_tx', models.FloatField()),
                ('packets_tx', models.BigIntegerField(default=0)),
                ('errs_tx', models.BigIntegerField(default=0)),
                ('drop_tx', models.BigIntegerField(default=0)),
                ('fifo_tx', models.BigIntegerField(default=0)),
                ('colls', models.BigIntegerField(default=0)),
                ('carrier', models.BigIntegerField(default=0)),
                ('compressed_tx', models.BigIntegerField(default=0)),
                ('ts', models.DateTimeField(db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='NFSDCallDistribution',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('ts', models.DateTimeField(db_index=True)),
                ('num_lookup', models.BigIntegerField(default=0)),
                ('num_read', models.BigIntegerField(default=0)),
                ('num_write', models.BigIntegerField(default=0)),
                ('num_create', models.BigIntegerField(default=0)),
                ('num_commit', models.BigIntegerField(default=0)),
                ('num_remove', models.BigIntegerField(default=0)),
                ('sum_read', models.BigIntegerField(default=0)),
                ('sum_write', models.BigIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='NFSDClientDistribution',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('ts', models.DateTimeField()),
                ('ip', models.CharField(max_length=15)),
                ('num_lookup', models.BigIntegerField(default=0)),
                ('num_read', models.BigIntegerField(default=0)),
                ('num_write', models.BigIntegerField(default=0)),
                ('num_create', models.BigIntegerField(default=0)),
                ('num_commit', models.BigIntegerField(default=0)),
                ('num_remove', models.BigIntegerField(default=0)),
                ('sum_read', models.BigIntegerField(default=0)),
                ('sum_write', models.BigIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='NFSDShareClientDistribution',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('ts', models.DateTimeField(db_index=True)),
                ('share', models.CharField(max_length=255)),
                ('client', models.CharField(max_length=100)),
                ('num_lookup', models.BigIntegerField(default=0)),
                ('num_read', models.BigIntegerField(default=0)),
                ('num_write', models.BigIntegerField(default=0)),
                ('num_create', models.BigIntegerField(default=0)),
                ('num_commit', models.BigIntegerField(default=0)),
                ('num_remove', models.BigIntegerField(default=0)),
                ('sum_read', models.BigIntegerField(default=0)),
                ('sum_write', models.BigIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='NFSDShareDistribution',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('ts', models.DateTimeField(db_index=True)),
                ('share', models.CharField(max_length=255)),
                ('num_lookup', models.BigIntegerField(default=0)),
                ('num_read', models.BigIntegerField(default=0)),
                ('num_write', models.BigIntegerField(default=0)),
                ('num_create', models.BigIntegerField(default=0)),
                ('num_commit', models.BigIntegerField(default=0)),
                ('num_remove', models.BigIntegerField(default=0)),
                ('sum_read', models.BigIntegerField(default=0)),
                ('sum_write', models.BigIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='NFSDUidGidDistribution',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('ts', models.DateTimeField(db_index=True)),
                ('share', models.CharField(max_length=255)),
                ('client', models.CharField(max_length=100)),
                ('uid', models.IntegerField(default=0)),
                ('gid', models.IntegerField(default=0)),
                ('num_lookup', models.BigIntegerField(default=0)),
                ('num_read', models.BigIntegerField(default=0)),
                ('num_write', models.BigIntegerField(default=0)),
                ('num_create', models.BigIntegerField(default=0)),
                ('num_commit', models.BigIntegerField(default=0)),
                ('num_remove', models.BigIntegerField(default=0)),
                ('sum_read', models.BigIntegerField(default=0)),
                ('sum_write', models.BigIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='PoolUsage',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('pool', models.CharField(max_length=4096)),
                ('free', models.BigIntegerField(default=0)),
                ('reclaimable', models.BigIntegerField(default=0)),
                ('ts', models.DateTimeField(auto_now=True, db_index=True)),
                ('count', models.BigIntegerField(default=1)),
            ],
        ),
        migrations.CreateModel(
            name='ReceiveTrail',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('snap_name', models.CharField(max_length=1024)),
                ('kb_received', models.BigIntegerField(default=0)),
                ('receive_pending', models.DateTimeField(null=True)),
                ('receive_succeeded', models.DateTimeField(null=True)),
                ('receive_failed', models.DateTimeField(null=True)),
                ('end_ts', models.DateTimeField(null=True, db_index=True)),
                ('status', models.CharField(max_length=10)),
                ('error', models.CharField(max_length=4096, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Replica',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('task_name', models.CharField(max_length=1024)),
                ('share', models.CharField(max_length=4096)),
                ('pool', models.CharField(max_length=4096)),
                ('appliance', models.CharField(max_length=4096)),
                ('dpool', models.CharField(max_length=4096)),
                ('dshare', models.CharField(max_length=4096, null=True)),
                ('enabled', models.BooleanField(default=False)),
                ('data_port', models.IntegerField(default=10002)),
                ('meta_port', models.IntegerField(default=10002)),
                ('ts', models.DateTimeField(null=True, db_index=True)),
                ('crontab', models.CharField(max_length=64, null=True)),
                ('replication_ip', models.CharField(max_length=4096, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='ReplicaShare',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('share', models.CharField(unique=True, max_length=4096)),
                ('pool', models.CharField(max_length=4096)),
                ('appliance', models.CharField(max_length=4096)),
                ('src_share', models.CharField(max_length=4096, null=True)),
                ('data_port', models.IntegerField(default=10002)),
                ('meta_port', models.IntegerField(default=10002)),
                ('ts', models.DateTimeField(null=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='ReplicaTrail',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('snap_name', models.CharField(max_length=1024)),
                ('kb_sent', models.BigIntegerField(default=0)),
                ('snapshot_created', models.DateTimeField(null=True)),
                ('snapshot_failed', models.DateTimeField(null=True)),
                ('send_pending', models.DateTimeField(null=True)),
                ('send_succeeded', models.DateTimeField(null=True)),
                ('send_failed', models.DateTimeField(null=True)),
                ('end_ts', models.DateTimeField(null=True, db_index=True)),
                ('status', models.CharField(max_length=10)),
                ('error', models.CharField(max_length=4096, null=True)),
                ('replica', models.ForeignKey(to='smart_manager.Replica')),
            ],
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=24)),
                ('display_name', models.CharField(unique=True, max_length=24)),
                ('config', models.CharField(max_length=8192, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='ServiceStatus',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('status', models.BooleanField(default=False)),
                ('count', models.BigIntegerField(default=1)),
                ('ts', models.DateTimeField(auto_now=True, db_index=True)),
                ('service', models.ForeignKey(to='smart_manager.Service')),
            ],
        ),
        migrations.CreateModel(
            name='ShareUsage',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=4096)),
                ('r_usage', models.BigIntegerField(default=0)),
                ('e_usage', models.BigIntegerField(default=0)),
                ('ts', models.DateTimeField(auto_now=True, db_index=True)),
                ('count', models.BigIntegerField(default=1)),
            ],
        ),
        migrations.CreateModel(
            name='SProbe',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=255)),
                ('display_name', models.CharField(max_length=255, null=True)),
                ('smart', models.BooleanField(default=False)),
                ('state', models.CharField(max_length=7, choices=[(b'created', b'created'), (b'error', b'error'), (b'running', b'running'), (b'stopped', b'stopped')])),
                ('start', models.DateTimeField(auto_now=True, db_index=True)),
                ('end', models.DateTimeField(null=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('state', models.CharField(max_length=64)),
                ('start', models.DateTimeField(null=True, db_index=True)),
                ('end', models.DateTimeField(null=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='TaskDefinition',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(unique=True, max_length=255)),
                ('task_type', models.CharField(max_length=100, choices=[(b'scrub', b'scrub'), (b'snapshot', b'snapshot')])),
                ('json_meta', models.CharField(max_length=8192)),
                ('enabled', models.BooleanField(default=True)),
                ('crontab', models.CharField(max_length=64, null=True)),
                ('crontabwindow', models.CharField(max_length=64, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='VmStat',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('free_pages', models.BigIntegerField(default=0)),
                ('ts', models.DateTimeField(auto_now=True, db_index=True)),
            ],
        ),
        migrations.AddField(
            model_name='task',
            name='task_def',
            field=models.ForeignKey(to='smart_manager.TaskDefinition'),
        ),
        migrations.AddField(
            model_name='receivetrail',
            name='rshare',
            field=models.ForeignKey(to='smart_manager.ReplicaShare'),
        ),
        migrations.AddField(
            model_name='nfsduidgiddistribution',
            name='rid',
            field=models.ForeignKey(to='smart_manager.SProbe'),
        ),
        migrations.AddField(
            model_name='nfsdsharedistribution',
            name='rid',
            field=models.ForeignKey(to='smart_manager.SProbe'),
        ),
        migrations.AddField(
            model_name='nfsdshareclientdistribution',
            name='rid',
            field=models.ForeignKey(to='smart_manager.SProbe'),
        ),
        migrations.AddField(
            model_name='nfsdclientdistribution',
            name='rid',
            field=models.ForeignKey(to='smart_manager.SProbe'),
        ),
        migrations.AddField(
            model_name='nfsdcalldistribution',
            name='rid',
            field=models.ForeignKey(to='smart_manager.SProbe'),
        ),
    ]
